﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<FriendTest.FriendService.PublishStatus>>" %>
<ul id="AllStatus">
     <%foreach (var status in Model)
          {%>
          <li id="statusListItem" style="list-style-type: disc">
           <%Html.RenderAction("ShowStatusByItemId", new { itemId = status.id }); %>
             <div id="comment_list<%=status.id %>" style="display:none">
                <%Html.RenderAction("ShowCmtList", new { id = status.id});%>            
           </div>
           <a id="<%="reply1"+status.id %>" style="display:inline" href="#nogo" onclick="document.getElementById('<%="comment_list"+status.id%>').setAttribute('style','display:block');
                                            document.getElementById('<%="reply"+status.id%>').setAttribute('style','display:inline');
                                            document.getElementById('<%="reply1"+status.id%>').setAttribute('style','display:none')">显示回复</a>           
           <a id="<%="reply"+status.id %>" style="display:none" href="#nogo" onclick="document.getElementById('<%="comment_list"+status.id%>').setAttribute('style','display:none');
                                            document.getElementById('<%="reply1"+status.id%>').setAttribute('style','display:inline');
                                            document.getElementById('<%="reply"+status.id%>').setAttribute('style','display:none')" >收起回复</a>
             <% using (Ajax.BeginForm("AddComment",
                                    new { itemId = status.id, fromUser = status.userId, toUser = 1 },
                                    new AjaxOptions
                                    {
                                        UpdateTargetId = "comment_list" + status.id,
                                        InsertionMode = InsertionMode.Replace
                                    }
                                                     ))
               { %>
                <%=Html.TextBox("comment", "添加回复")%>
                <input type="submit" value="回复" />
           <%} %>
           </li>
   <%} %>
</ul>
 


